package com.six.vo;

import java.sql.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 托盘
 * 
 */
@Entity
@Table(name="WMS_T_TRAY")
public class Tray {
	private int trayID;// VARCHAR(16) 托盘编号
	private String trayCode;// CHAR(5) 托盘可视编号
	private String rfidCode;// NVARCHAR2(60) RFID 标签硬件编号
	private String trayState;// VARCHAR(16) 托盘状态
	private Date trayEditTime;// DATE 最后编辑时间
	private int trayIsDel;// SMALLINT 是否已被删除
	private Set<BillDetail> billDetail;
	private Site site;
	
	public Tray() {
		super();
	}
	public Tray(int trayID, String trayCode, String rfidCode,
			String trayState, Date trayEditTime, int trayIsDel,
			Set<BillDetail> billDetail, Site site) {
		super();
		this.trayID = trayID;
		this.trayCode = trayCode;
		this.rfidCode = rfidCode;
		this.trayState = trayState;
		this.trayEditTime = trayEditTime;
		this.trayIsDel = trayIsDel;
		this.billDetail = billDetail;
		this.site = site;
	}
	@Id
	@GeneratedValue
	public int getTrayID() {
		return trayID;
	}
	public void setTrayID(int trayID) {
		this.trayID = trayID;
	}
	public String getTrayCode() {
		return trayCode;
	}
	public void setTrayCode(String trayCode) {
		this.trayCode = trayCode;
	}
	public String getRfidCode() {
		return rfidCode;
	}
	public void setRfidCode(String rfidCode) {
		this.rfidCode = rfidCode;
	}
	public String getTrayState() {
		return trayState;
	}
	public void setTrayState(String trayState) {
		this.trayState = trayState;
	}
	public Date getTrayEditTime() {
		return trayEditTime;
	}
	public void setTrayEditTime(Date trayEditTime) {
		this.trayEditTime = trayEditTime;
	}
	public int getTrayIsDel() {
		return trayIsDel;
	}
	public void setTrayIsDel(int trayIsDel) {
		this.trayIsDel = trayIsDel;
	}
	@OneToMany(cascade=CascadeType.ALL)
	public Set<BillDetail> getBillDetail() {
		return billDetail;
	}
	public void setBillDetail(Set<BillDetail> billDetail) {
		this.billDetail = billDetail;
	}
	@ManyToOne(cascade={CascadeType.ALL})           
    @JoinColumn(name="siteID") 	 // VARCHAR(16) 所在仓位编号
	public Site getSite() {
		return site;
	}
	public void setSite(Site site) {
		this.site = site;
	}
	

}
